import USART
import time


sender = USART.SerialSender("/dev/ttyS4", 115200)
print("/dev/ttyS4;115200")
received_array=[0xFF,0x11,0,0,0,0xAA]


def input_and_operate():
    try:
        while True:
            print("number 1 is change_for_ROS_Avoid\n number 0 is break while")
            user_input = input("input number:")
            if user_input == "1":
                
                sender.air_change_serial(received_array)
                print("change suceessful")
            elif user_input == "0":
                print("break")
                break
            else:
                print("not number 1 and 0")
    except KeyboardInterrupt:
        print("head to turn down")
    except Exception as e:
        print(f"chuxian yichang{e}")


if __name__ == '__main__':
  input_and_operate()
    
  